<%@page contentType="text/html;charset=utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>登录 - 当当网</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link href="/dangdang_wangxy/css/login.css" rel="stylesheet" type="text/css" />
		<link href="/dangdang_wangxy/css/page_bottom.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="/dangdang_wangxy/js/jquery-1.7.2.min.js"></script>
		<script type="text/javascript">
			/*json用于验证邮箱是否存在*/
			//btnSignCheck
			$(function(){
				$("#btnSignCheck").click(function(){
					$.ajax({
						type:"post",
						data:{useremail:$("#txtUsername").val()},
						url:"<s:url action='checkUserEmail'/>",
						success:function(result){
							if(result == "t"){
								/* alert("用户不存在！") */
								$("#loginspan").text("");
								$("#loginspan").text("用户名不存在！");
							}else{
								//判断密码是否为空
								if($("#txtPassword").val().length > 0){
									$("form").submit();
								}else{
									$("#loginspan").text("");
									$("#loginspan").text("密码不能为空！")
									/* alert("密码不能为空！"); */
								} 
							}
						}
					});
				});
			});
		</script>
	</head>
	<body>
		<%@include file="../common/head1.jsp"%>
		<div class="enter_part">
			<%@include file="../common/introduce.jsp"%>
			<div class="enter_in">
				<div class="bj_top"></div>
				<div class="center">
					<div style="height: 30px; padding: 5px; color: red" id="divErrorMssage">
					</div>
					<div class="main">
						<h3>
							登录当当网
						</h3>
						<form method="post" action='<s:url action="userLogin" namespace="/user"/>' id="ctl00">
						<span style="color:red;" id="loginspan"></span>
							<ul>
								<li>
									<span>请输入Email地址：</span>
									<input type="text" name="user.useremail" id="txtUsername" class="textbox" />
								</li>
								<li>
									<span class="blank">密码：</span>
									<input type="password" name="user.userpassword" id="txtPassword"
										class="textbox" />
								</li>
								<li>
									<input type="button" id="btnSignCheck" class="button_enter"value="登 录" />
								</li>
							</ul>	
							<input type="hidden" name="uri" value="${uri}" />
						</form>
					</div>
					<div class="user_new">
						<p>
							您还不是当当网用户？
						</p>
						<p class="set_up">
							<a href="register_form.jsp">创建一个新用户&gt;&gt;</a>
						</p>
					</div>
				</div>
			</div>
		</div>
		<%@include file="../common/foot1.jsp"%>
	</body>
</html>